package com.ean.backpack.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ean.backpack.domain.Policydescriptionlist;
import com.ean.backpack.repository.PolicydescriptionlistRepository;
import com.ean.backpack.service.PolicydescriptionlistService;

@Service
@Transactional
public class PolicydescriptionlistServiceImpl implements
		PolicydescriptionlistService {

	@Autowired
	PolicydescriptionlistRepository policydescriptionlistRepository;

	public long countAllPolicydescriptionlists() {
		return policydescriptionlistRepository.count();
	}

	public void deletePolicydescriptionlist(
			Policydescriptionlist policydescriptionlist) {
		policydescriptionlistRepository.delete(policydescriptionlist);
	}

	public Policydescriptionlist findPolicydescriptionlist(Integer id) {
		return policydescriptionlistRepository.findOne(id);
	}

	public List<Policydescriptionlist> findAllPolicydescriptionlists() {
		return policydescriptionlistRepository.findAll();
	}

	public List<Policydescriptionlist> findPolicydescriptionlistEntries(
			int firstResult, int maxResults) {
		return policydescriptionlistRepository.findAll(
				new org.springframework.data.domain.PageRequest(firstResult
						/ maxResults, maxResults)).getContent();
	}

	public void savePolicydescriptionlist(
			Policydescriptionlist policydescriptionlist) {
		policydescriptionlistRepository.save(policydescriptionlist);
	}

	public Policydescriptionlist updatePolicydescriptionlist(
			Policydescriptionlist policydescriptionlist) {
		return policydescriptionlistRepository.save(policydescriptionlist);
	}
}
